<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<input type="text" name="" id="input1" value="" />
		<select name="" id="s1">
			<option value="运算符">运算符</option>
			<option value="+">+</option>
			<option value="-">-</option>
			<option value="*">*</option>
			<option value="/">/</option>
		</select>
		<input type="text" name="" id="input2" value="" />
		<button type="button" onclick="btn1();">=</button>
		<input type="text" name="" id="input3" value="" />
	</body>
	<script type="text/javascript">
	function btn1(){
		var a = parseInt(input1.value)
		var b = parseInt(input2.value)
		if (s1.value == '+') {
			input3.value = a+b;
		}
		else if(s1.value == '-'){
			input3.value = a-b;
		}
		else if(s1.value == '*'){
			input3.value = a*b;
		}
		else if(s1.value == '/'){
			input3.value = a/b;
		}
		else if(s1.value == '运算符'){
			alert('请选择运算符');
		}
	}
	</script>
</html>
